﻿using System;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using VIT.DataHelper.DataAccess;

namespace VIT.Business
{
    public class Link : Link_Base
    {
        SQLSupport sqlSupport = new SQLSupport();

        #region Constructor
        public Link(string Id = "",
                        string LanguageId = "",
                        string Name = "",
                        string URL = "",
                        int Orders = 50)
        {
            this.Id = Id;
            this.LanguageId = LanguageId;
            this.Name = Name;
            this.URL = URL;
        }
        #endregion

        #region Pre
        public DataTable GetList()
        {
            string strQuery = "select Id, Name, URL from Link, Link_Language where Id=LinkId and LanguageID=@LanguageID and Published=1 order by Orders";
            SqlParameter LanguageId = new SqlParameter("@LanguageID", this.LanguageId);
            return sqlSupport.ExecuteDataset(false, strQuery, LanguageId).Tables[0];
        }
        #endregion
    }
}
